<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>外边距合并</title>
    <style>
        *{
            margin: 0px;
            padding: 0px;
        }
        .s1{
            width: 400px;
            height: 400px;
            background-color: aqua;
            margin-top: 30px;
        }
        .s2{
             width: 200px;
            height: 200px;
            background-color: rgb(34, 173, 34);
            margin-top: 20px;
        }
    </style>
</head>
<body>
    
    <div class="s1">
        <div class="s2"></div>
    </div>
</body>
</html>